package com.yuntian.service.Impl;


import com.yuntian.entity.DepartmentMaster;
import com.yuntian.mapper.DepartmentMapper;
import com.yuntian.service.DepartmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 部门服务实现类
 * @author yuntian
 */
@Service
@RequiredArgsConstructor
public class DepartmentServiceImpl implements DepartmentService {

   private final DepartmentMapper departmentMapper;

    /**
     * 获取所有部门
     * @return 部门列表
     * @author yuntian
     */
    @Override
    public List<DepartmentMaster> getAllDepartments() {
               return departmentMapper.getAllDepartments();
    }

    /**
     * 根据部门コード获取部门信息
     * @param code 部门コード
     * @return 部门信息
     * @author yuntian
     */
    @Override
    public DepartmentMaster getDepartmentByCode(String code) {
        return departmentMapper.getDepartmentByCode(code);
    }
}
